package cn.usian.controller;

import cn.usian.pojo.User;
import cn.usian.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;
    @RequestMapping("/findAll")
    public List<User>findAll(){
            return userService.findAll();
    }
    @GetMapping("del")
    public void del(Integer id){
        userService.del(id);
    }
}
